const searchBookInput = document.getElementsByClassName("searchProblemText")[0];
const searchBookBtn = document.getElementsByClassName("searchProblemBtn")[0];



searchBookBtn.addEventListener('click',()=>{
    var searchProblemText = searchBookInput.value
    location.href = `http://localhost:8080/library/admin/problemManage?searchProblemText=${searchProblemText}`;
});

const changeStatusBtn = document.getElementsByClassName("changeStatus");

for (let i=0; i<changeStatusBtn.length; i++){
    changeStatusBtn[i].addEventListener('click',()=>{
        let pid = changeStatusBtn[i].getAttribute("pid");
        if(confirm(`你确定要完成id为${pid}的处理吗`)){
            location.href = `http://localhost:8080/library/admin/changeStatus?pid=${pid}`;
        }
        return false;
    });
}
